{% extends "pretixcontrol/admin/base.html" %}
{% load i18n %}

{% block video_admin_content %}
<h1 class="page-header">{% trans "Janus servers" %}</h1>
<div class="video-admin-btn-row">
    <a href="{% url 'eventyay_admin:video_admin:janusserver.create' %}" class="btn btn-primary btn-sm">
        <span class="fa fa-plus"></span> {% trans "Add new server" %}
    </a>
</div>
<div class="video-admin-table-wrapper">
<table class="table table-striped table-hover video-admin-table">
    <thead>
    <tr>
        <th>{% trans "ID" %}</th>
        <th>{% trans "URL" %}</th>
        <th>{% trans "Event" %}</th>
        <th class="text-right" colspan="2">{% trans "Actions" %}</th>
    </tr>
    </thead>
    <tbody>
    {% for s in servers %}
    <tr class="{% if not s.active %}deleted{% endif %}">
        <td><code>{{ s.pk }}</code></td>
        <td>{{ s.url }}</td>
        <td>
            {% if s.event_exclusive %}
                {{ s.event_exclusive }}
            {% else %}
                {% trans "All" %}
            {% endif %}
        </td>
        <td class="text-right video-admin-actions">
            <a href="{% url 'eventyay_admin:video_admin:janusserver.update' pk=s.pk %}" class="btn btn-default btn-xs">
                <span class="fa fa-pencil"></span> {% trans "Edit" %}
            </a>
            <a href="{% url 'eventyay_admin:video_admin:janusserver.delete' pk=s.pk %}" class="btn btn-danger btn-xs">
                <span class="fa fa-trash"></span> {% trans "Delete" %}
            </a>
        </td>
    </tr>
    {% empty %}
        <tr><td colspan="5" class="text-muted">{% trans "No servers configured yet." %}</td></tr>
    {% endfor %}
    </tbody>
</table>
</div>
{% endblock %}
